// 项目入口文件
import Koa from 'koa';
import serve from 'koa-static';
import router from './routes/index.js' //此时的router就等价与./routes/index.js中导出的router是同一个对象
import config from '../config/config.js'

const app = new Koa();

app.use(router.routes());	

app.use(serve(__dirname+ "/views"));

app.listen(config.port);

console.log('koa2 is started at port 3000');